<?php
	class Ykien extends CI_Model
    {
        public $ID;
        public $HoTen;
        public $DiaChi;
        public $SoDienThoai;
        public $Email;
        public $NoiDungGopY;
        public function __construct() {
            parent::__construct();
            $this->load->database();
        }
        
        public function LayYKien($where = null, $reject_id = null, $limit = null, $start = null)
        {
            if($where != null) $this->db->where($where);
            if($reject_id != null) $this->db->where('id <>', $this->ID);
            if($limit != null && $start != null) $this->db->limit($limit, $start);
            $query = $this->db->get('ykienkhachhang');
            return $query;
        }
        
        public function ThemYKienKhachHang()
        {
            $data = array('hoten' => $this->HoTen,
                          'diachi' => $this->DiaChi,
                          'phone' => $this->SoDienThoai,
                          'email' => $this->Email,
                          'noidung' => $this->NoiDungGopY);            
            $result =  $this->db->insert('ykienkhachhang', $data);
            return $result;
        }
    }
?>